package com.redpack.quick.datasource.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by shuttle on 4/2/18.
 */
@Entity
@Table(name = "task", schema = "red_paper", catalog = "")
public class TaskEntity {
    private long id;
    private long companyId;
    private String name;
    private int leftNo;
    private String priceDes;
    private String logo;
    private String taskDes;
    private Timestamp updateTime;
    private Timestamp createTime;
    private Integer taskType;
    private String qrIcon;
    private String qrUrl;
    private String visitUrl;

    @Id
    @Column(name = "id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "company_id")
    public long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(long companyId) {
        this.companyId = companyId;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "left_no")
    public int getLeftNo() {
        return leftNo;
    }

    public void setLeftNo(int leftNo) {
        this.leftNo = leftNo;
    }

    @Basic
    @Column(name = "price_des")
    public String getPriceDes() {
        return priceDes;
    }

    public void setPriceDes(String priceDes) {
        this.priceDes = priceDes;
    }

    @Basic
    @Column(name = "logo")
    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    @Basic
    @Column(name = "task_des")
    public String getTaskDes() {
        return taskDes;
    }

    public void setTaskDes(String taskDes) {
        this.taskDes = taskDes;
    }

    @Basic
    @Column(name = "update_time", insertable = false, updatable = false)
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "create_time", insertable = false, updatable = false)
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "task_type")
    public Integer getTaskType() {
        return taskType;
    }

    public void setTaskType(Integer taskType) {
        this.taskType = taskType;
    }

    @Basic
    @Column(name = "qr_icon")
    public String getQrIcon() {
        return qrIcon;
    }

    public void setQrIcon(String qrIcon) {
        this.qrIcon = qrIcon;
    }

    @Basic
    @Column(name = "qr_url")
    public String getQrUrl() {
        return qrUrl;
    }

    public void setQrUrl(String qrUrl) {
        this.qrUrl = qrUrl;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TaskEntity that = (TaskEntity) o;

        if (id != that.id) return false;
        if (companyId != that.companyId) return false;
        if (leftNo != that.leftNo) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (priceDes != null ? !priceDes.equals(that.priceDes) : that.priceDes != null) return false;
        if (logo != null ? !logo.equals(that.logo) : that.logo != null) return false;
        if (taskDes != null ? !taskDes.equals(that.taskDes) : that.taskDes != null) return false;
        if (updateTime != null ? !updateTime.equals(that.updateTime) : that.updateTime != null) return false;
        if (createTime != null ? !createTime.equals(that.createTime) : that.createTime != null) return false;
        if (taskType != null ? !taskType.equals(that.taskType) : that.taskType != null) return false;
        if (qrIcon != null ? !qrIcon.equals(that.qrIcon) : that.qrIcon != null) return false;
        if (qrUrl != null ? !qrUrl.equals(that.qrUrl) : that.qrUrl != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (id ^ (id >>> 32));
        result = 31 * result + (int) (companyId ^ (companyId >>> 32));
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + leftNo;
        result = 31 * result + (priceDes != null ? priceDes.hashCode() : 0);
        result = 31 * result + (logo != null ? logo.hashCode() : 0);
        result = 31 * result + (taskDes != null ? taskDes.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (taskType != null ? taskType.hashCode() : 0);
        result = 31 * result + (qrIcon != null ? qrIcon.hashCode() : 0);
        result = 31 * result + (qrUrl != null ? qrUrl.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "visit_url")
    public String getVisitUrl() {
        return visitUrl;
    }

    public void setVisitUrl(String visitUrl) {
        this.visitUrl = visitUrl;
    }
}
